package dk.dashboardFP.panels.loggerPanel {
	import dk.dashboardFP.panels.subPanels.ui.windowSubPanelUI.WindowSubPanelUI;
	import dk.dashboardFP.panels.panelElements.AbstractDashboardFPPanel;
	import dk.dashboardFP.panels.subPanels.WindowSubPanel;

	/**
	 * @author josef
	 */
	public class LogWindowSubPanel extends WindowSubPanel {
		private var _doLoggerWindowContent : LoggerWindowContent;
		private var _oFilterSubPanel : FilterWindowSubPanel;

		public function LogWindowSubPanel(oDashboardFPPanel : AbstractDashboardFPPanel, sSubPanelPlaneTitle : String, oFilterSubPanel:FilterWindowSubPanel) {
			_oFilterSubPanel = oFilterSubPanel;
			super(oDashboardFPPanel, sSubPanelPlaneTitle);
			setupElements();
		}
		
		private function setupElements() : void {
			
			//:::::::
			// window content 
			_doLoggerWindowContent=new LoggerWindowContent(_oFilterSubPanel.o_doLogFilterItems);
			WindowSubPanelUI(_doSubPanelUI).addWindowContent(_doLoggerWindowContent);
			
			//:::::::
			// register filter window sub panel 
			_oFilterSubPanel.oWindowSubPanelMode.addEventListener(FilterWindowModelEvent.FILTERS_UPDATED, onFiltersUpdated, false, 0, true);
		}
		
		private function onFiltersUpdated(event : FilterWindowModelEvent) : void {
			_doLoggerWindowContent.updateFilters();
		}

		public function get doLoggerWindowContent() : LoggerWindowContent {
			return _doLoggerWindowContent;
		}
	}
}
